#ifndef CLICKEDBTN_H
#define CLICKEDBTN_H

#include <QPushButton>

class ClickedBtn:public QPushButton
{
    Q_OBJECT
public:
    ClickedBtn(QWidget *parent = nullptr);

    void SetState(QString normal, QString hover, QString press);
protected:
    // 处理鼠标安下事件
    void mousePressEvent(QMouseEvent* e) override;
    // 处理鼠标释放事件
    void mouseReleaseEvent(QMouseEvent* e) override;

    // 处理鼠标悬停进入事件
    void enterEvent(QEnterEvent *event) override;
    // 处理鼠标悬停离开事件
    void leaveEvent(QEvent *event) override;
private:
    QString _normal;    //正常
    QString _hover;     //悬停
    QString _press;     //按下
};

#endif // CLICKEDBTN_H
